Skip to content

Download Charis SIL test font instead of committing it#945

Merged
johnml1135 merged 2 commits into
mainfrom
claude/views-charis-download
Jun 11, 2026
Merged

Download Charis SIL test font instead of committing it#945
johnml1135 merged 2 commits into
mainfrom
claude/views-charis-download

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The Views native shaping tests (TestViews / TestUniscribeEngine.h) relied on a copy of Charis SIL 5.000 committed under Src/views/Test/TestData/Fonts/. This removes the committed font and instead downloads Charis SIL 6.200 from a pinned GitHub release (silnrsi/font-charis) at build time — mirroring how other build dependencies (GeckofxHtmlToPdf, pc-parse) are already pulled in PackageRestore.targets.

What changed

  • PackageRestore.targets — download CharisSIL-6.200.zip from the pinned release into the git-ignored Downloads/ and unzip it, guarded by !Exists (download-once). Version is a single CharisSilVersion property.
  • TestViews.vcxproj / .filters — drop the committed-font <None> items; CopyCharisSilTestFont copies the downloaded regular face to a version-less TestData\Fonts\CharisSIL\. The copy source is tied to the exact pinned version folder (CharisSIL-6.200) via a CharisSilTestFontVersion property kept in sync with CharisSilVersion — not a wildcard — so the test font selection is deterministic even if Downloads/ holds more than one extracted version.
  • TestUniscribeEngine.h — point the runtime font path at CharisSIL\CharisSIL-Regular.ttf, and switch the OpenType metrics test from liga to smcp. In Charis 6.x the fi/ffi ligatures keep the component advance widths, so liga changes the rendered glyphs (still covered by the pixel tests) without changing segment metrics; small caps reliably change advance width, and the pixel tests already use smcp.
  • RootSiteTests.csproj — applied the same exact-version pinning to the analogous Scheherazade New font copy (from Fix flaky render snapshot tests caused by blinking caret #943), per review feedback, for the same deterministic-selection reason.

The font family name is unchanged (Charis SIL through v6.x; v7 renames it to Charis), so no test face-name changes were needed.

Versions

Font Pinned release Properties (must stay in sync)
Charis SIL v6.200 CharisSilVersion (PackageRestore.targets) / CharisSilTestFontVersion (TestViews.vcxproj)
Scheherazade New v4.500 ScheherazadeNewVersion (PackageRestore.targets) / ScheherazadeNewTestFontVersion (RootSiteTests.csproj)

Verification

  • Native TestViews (Charis shaping): [301-0-0] pass (was [300-1-0] before the ligasmcp change).
  • RootSiteTests RenderBenchmark (incl. rtl-script/multi-ws via Scheherazade): 38/38 pass.
  • Clean Debug build; both fonts download/unzip/copy to the pinned paths.

Reviewer notes

  • The downloaded zip/font live under git-ignored Downloads/ and the build output — nothing font-related is committed.
  • The installer's separate end-user Charis font (FLExInstaller/...) is intentionally untouched.

🤖 Generated with Claude Code


This change is Reviewable

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Render comparison artifacts

Render snapshot failures were reported in b3f93e10ff1c run 27309998687.1, but the latest run 372e2a9cbdcf run 27360050809.1 is clean.

This comment will be replaced if a future run produces render snapshot failures again.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   10m 7s ⏱️ -21s
4 251 tests ±0  4 178 ✅ ±0  73 💤 ±0  0 ❌ ±0 
4 260 runs  ±0  4 187 ✅ ±0  73 💤 ±0  0 ❌ ±0 

Results for commit 59bb6aa. ± Comparison against base commit 2d5b78b.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the committed Charis SIL 5.000 test font used by the Views native shaping tests and replaces it with a build-time download of Charis SIL 6.200 from a pinned GitHub release, updating the native tests to load the new font path and adjusting the OpenType metrics assertion to use smcp.

Changes:

  • Added a pinned Charis SIL download + unzip step to Build/PackageRestore.targets (download-once into Downloads/).
  • Updated TestViews.vcxproj / .filters to stop including committed font artifacts and to copy the downloaded CharisSIL-Regular.ttf into the test output under a version-less folder.
  • Updated TestUniscribeEngine.h to load the font from the new output path and to validate metrics changes via smcp instead of liga.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Build/PackageRestore.targets Adds a pinned Charis SIL 6.200 ZIP download and unzip into Downloads/CharisSIL for the native Views tests.
Src/views/Test/TestViews.vcxproj Removes committed font items and adds a post-build copy step to place the downloaded font beside TestViews.exe.
Src/views/Test/TestViews.vcxproj.filters Removes the committed Charis SIL font artifacts from the VS filters list.
Src/views/Test/TestUniscribeEngine.h Updates the runtime font path and switches the metrics test from liga to smcp.
Src/views/Test/TestData/Fonts/CharisSIL-5.000/README.txt Removes the previously committed Charis SIL 5.000 README from the repo.
Src/views/Test/TestData/Fonts/CharisSIL-5.000/OFL.txt Removes the previously committed Charis SIL 5.000 OFL license text from the repo.

Comment thread Src/views/Test/TestViews.vcxproj Outdated
Comment on lines +446 to +449
<Target Name="CopyCharisSilTestFont" AfterTargets="Build">
<ItemGroup>
<CharisSilTestFont Include="$(FwRoot)\Downloads\CharisSIL\**\CharisSIL-Regular.ttf" />
</ItemGroup>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason not to tie this to a specific version. We want deterministic behavior more than anything else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — determinism first. Pinned in 59bb6aa: both the Charis copy here (TestViews.vcxproj) and the analogous Scheherazade copy (RootSiteTests.csproj, from #943) now reference the exact version folder (CharisSIL-6.200 / ScheherazadeNew-4.500) via a property kept in sync with the *Version in PackageRestore.targets, instead of a ** glob. The copy destination stays version-less, so the runtime font paths are unchanged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 59bb6aa — replaced the recursive ** glob with the exact pinned-version path, so a second extracted version under Downloads/ can no longer be picked up nondeterministically.

@johnml1135 johnml1135 force-pushed the claude/views-charis-download branch from 48b840b to 4ef9c78 Compare June 11, 2026 00:32

@johnml1135 johnml1135 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version for Fonts

jasonleenaylor and others added 2 commits June 11, 2026 08:30
The Views shaping tests bundled CharisSIL 5.000 in the repo. Instead,
download Charis SIL 6.200 from a pinned GitHub release at build time into
the git-ignored Downloads/ and copy it beside TestViews.exe; remove the
committed font.

The OpenType metrics test moves from liga to smcp: in Charis 6.x the
fi/ffi ligatures keep the component advance widths, so liga changes the
rendered glyphs (still covered by the pixel tests) without changing
segment metrics, whereas small caps do change advance width.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address review feedback: the AfterBuild copy targets used a recursive glob
(CharisSIL\**, ScheherazadeNew\**) that could match more than one extracted
version in Downloads/, making the copied test font nondeterministic. Tie each
copy to the exact pinned version (kept in sync with the *Version property in
PackageRestore.targets). The destination stays version-less, so the runtime
font paths are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jasonleenaylor jasonleenaylor force-pushed the claude/views-charis-download branch from 4ef9c78 to 59bb6aa Compare June 11, 2026 15:59

@johnml1135 johnml1135 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnml1135 reviewed 8 files and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on jasonleenaylor).

@johnml1135 johnml1135 merged commit 1b0a2a9 into main Jun 11, 2026
7 checks passed
@johnml1135 johnml1135 deleted the claude/views-charis-download branch June 11, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants